package com.liukai.todo_android.entity.vo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Freeman Liu
 */
public class QueryVo {
    private int currPage = 1;
    private int pageSize = 100;
    private String searchKey;

    public int getCurrPage() {
        return currPage;
    }

    public QueryVo setCurrPage(int currPage) {
        this.currPage = currPage;
        return this;
    }

    public int getPageSize() {
        return pageSize;
    }

    public QueryVo setPageSize(int pageSize) {
        this.pageSize = pageSize;
        return this;
    }

    public String getSearchKey() {
        return searchKey;
    }

    public QueryVo setSearchKey(String searchKey) {
        this.searchKey = searchKey;
        return this;
    }

    @Override
    public String toString() {
        return "QueryVo{" +
                "currPage=" + currPage +
                ", pageSize=" + pageSize +
                ", searchKey='" + searchKey + '\'' +
                '}';
    }

    public Map<String, Object> buildMap() {
        Map<String, Object> map = new HashMap<>(6);
        map.put("currPage", this.getCurrPage());
        map.put("pageSize", this.getPageSize());
        if (this.getSearchKey() != null) {
            map.put("searchKey", this.getSearchKey());
        }
        return map;
    }
}
